/*
 * All rights Reserved, Designed By DataDriver
 * Copyright:    DataDriver.Inc
 * Company:      Zhuo Wo Infomation Technology (ShangHai) CO.LTD
 */
package com.sun.imports;

import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;
import org.springframework.stereotype.Component;

import java.util.function.Predicate;

/**
 * 实现导入选择器来实现组件的导入操作
 */
public class MyBeanImport implements ImportSelector {

    //返回值就是要导入到IOC中的类的全类名

    /**
     * AnnotationMetadata 注解信息
     *
     * @param importingClassMetadata
     * @return
     */
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        //将Blue注入IOC容器中
        return new String[]{"com.sun.bean.Blue"};
    }

    @Override
    public Predicate<String> getExclusionFilter() {
        return null;
    }
}
